unexpected }

unexpected }

am 19.11.2007 06:44:14 von Jim Michaels

I have a 638 line glob of PHP code & HTML that won't run.
I get "PHP Parse error: syntax error, unexpected '}' in quiz\\quiz.php
on line 594".
I wrote a brace checker that checks perens, square brackets, and curly
braces for mismatches & opens and it checks out perfect. so I don't
know what it is about the curly brace error. it's false.
anybody have a clue as to what the real error might be? the code looks
pristine to me.

------------------------------------
Jim Michaels
for email, edit the address

"Because we do not understand the brain very well we are constantly
tempted to use the latest technology as a model for trying to understand
it. In my childhood we were always assured that the brain was a
telephone switchboard. ('What else could it be?') I was amused to see
that Sherrington, the great British neuroscientist, thought that the
brain worked like a telegraph system. Freud often compared the brain to
hydraulic and electro-magnetic systems. Leibniz compared it to a mill,
and I am told some of the ancient Greeks thought the brain functions
like a catapult. At present, obviously, the metaphor is the digital
computer." - John R Searls.

Re: unexpected }

am 19.11.2007 08:18:15 von Bucky Kaufman

"Jim Michaels" wrote in message
news:FdCdnTMkRqMsv9zanZ2dnUVZ_q-jnZ2d@comcast.com...
>I have a 638 line glob of PHP code & HTML that won't run.
> I get "PHP Parse error: syntax error, unexpected '}' in quiz\\quiz.php on
> line 594".
> I wrote a brace checker that checks perens, square brackets, and curly
> braces for mismatches & opens and it checks out perfect. so I don't know
> what it is about the curly brace error. it's false.
> anybody have a clue as to what the real error might be? the code looks
> pristine to me.

It does appear, from that description, that the error is in error.
But, just on a lark, look to see if you have "{$" inside a string somewhere.
Curly bracket followed by a dollar sign tells PHP that it's a complex,
inline variable.
So, if you that, it could produce the error you describe, without raising
the alarm with your bracket-checker.






>
> ------------------------------------
> Jim Michaels
> for email, edit the address
>
> "Because we do not understand the brain very well we are constantly
> tempted to use the latest technology as a model for trying to understand
> it. In my childhood we were always assured that the brain was a telephone
> switchboard. ('What else could it be?') I was amused to see that
> Sherrington, the great British neuroscientist, thought that the brain
> worked like a telegraph system. Freud often compared the brain to
> hydraulic and electro-magnetic systems. Leibniz compared it to a mill, and
> I am told some of the ancient Greeks thought the brain functions like a
> catapult. At present, obviously, the metaphor is the digital
> puter." - John R Searls.

Re: unexpected }

am 19.11.2007 14:04:14 von Jerry Stuckle

Jim Michaels wrote:
> I have a 638 line glob of PHP code & HTML that won't run.
> I get "PHP Parse error: syntax error, unexpected '}' in quiz\\quiz.php
> on line 594".
> I wrote a brace checker that checks perens, square brackets, and curly
> braces for mismatches & opens and it checks out perfect. so I don't
> know what it is about the curly brace error. it's false.
> anybody have a clue as to what the real error might be? the code looks
> pristine to me.
>
> ------------------------------------
> Jim Michaels
> for email, edit the address
>
> "Because we do not understand the brain very well we are constantly
> tempted to use the latest technology as a model for trying to understand
> it. In my childhood we were always assured that the brain was a
> telephone switchboard. ('What else could it be?') I was amused to see
> that Sherrington, the great British neuroscientist, thought that the
> brain worked like a telegraph system. Freud often compared the brain to
> hydraulic and electro-magnetic systems. Leibniz compared it to a mill,
> and I am told some of the ancient Greeks thought the brain functions
> like a catapult. At present, obviously, the metaphor is the digital
> computer." - John R Searls.
>

Jim,

Obviously there's a mismatch somewhere :-). Did your brace checker
ignore braces within strings? Or within comments? Either one can throw
it off.

Try a editor with syntax highlighting. On Windows I recommend Crimson;
it has the added advantage of matching up braces for you.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: unexpected }

am 19.11.2007 19:01:53 von luiheidsgoeroe

On Mon, 19 Nov 2007 06:44:14 +0100, Jim Michaels
wrote:

> I have a 638 line glob of PHP code & HTML that won't run.
> I get "PHP Parse error: syntax error, unexpected '}' in quiz\\quiz.php
> on line 594".
> I wrote a brace checker that checks perens, square brackets, and curly
> braces for mismatches & opens and it checks out perfect. so I don't
> know what it is about the curly brace error. it's false.
> anybody have a clue as to what the real error might be? the code looks
> pristine to me.

An unexpected '}' doesn't mean that curly brace should not be there. For
me, most of the time I get this it means the previous expression wasn't
finished (missing ')' or ';'). If you'd have posted you code leading up to
the offending brace at line 594 maybe we could spot it...
--
Rik Wasmus

Re: unexpected }

am 20.11.2007 06:20:15 von Jim Michaels

Jerry Stuckle wrote:
> Jim Michaels wrote:
>> I have a 638 line glob of PHP code & HTML that won't run.
>> I get "PHP Parse error: syntax error, unexpected '}' in
>> quiz\\quiz.php on line 594".
>> I wrote a brace checker that checks perens, square brackets, and curly
>> braces for mismatches & opens and it checks out perfect. so I don't
>> know what it is about the curly brace error. it's false.
>> anybody have a clue as to what the real error might be? the code
>> looks pristine to me.
>>
>> ------------------------------------
>> Jim Michaels
>> for email, edit the address
>>
>> "Because we do not understand the brain very well we are constantly
>> tempted to use the latest technology as a model for trying to
>> understand it. In my childhood we were always assured that the brain
>> was a telephone switchboard. ('What else could it be?') I was amused
>> to see that Sherrington, the great British neuroscientist, thought
>> that the brain worked like a telegraph system. Freud often compared
>> the brain to hydraulic and electro-magnetic systems. Leibniz compared
>> it to a mill, and I am told some of the ancient Greeks thought the
>> brain functions like a catapult. At present, obviously, the metaphor
>> is the digital computer." - John R Searls.
>>
>
> Jim,
>
> Obviously there's a mismatch somewhere :-). Did your brace checker
> ignore braces within strings? Or within comments? Either one can throw
> it off.
>
> Try a editor with syntax highlighting. On Windows I recommend Crimson;
> it has the added advantage of matching up braces for you.
>
>

it ignores within comments. and as I said, braces match.

--

------------------------------------
Jim Michaels
for email, edit the address

"Because we do not understand the brain very well we are constantly
tempted to use the latest technology as a model for trying to understand
it. In my childhood we were always assured that the brain was a
telephone switchboard. ('What else could it be?') I was amused to see
that Sherrington, the great British neuroscientist, thought that the
brain worked like a telegraph system. Freud often compared the brain to
hydraulic and electro-magnetic systems. Leibniz compared it to a mill,
and I am told some of the ancient Greeks thought the brain functions
like a catapult. At present, obviously, the metaphor is the digital
computer." - John R Searls.

Re: unexpected }

am 20.11.2007 10:38:31 von FFMG

Jim Michaels;104397 Wrote:
>
> it ignores within comments. and as I said, braces match.
>

Well, sorry, but obviously they don't.
I'd like to think that php has its braces covered by now.

Without seen the code it is very hard to tell where there is a
mismatch.
We don't even know you brace checking code, there could also be a
problem in that.

FFMG.


--

'webmaster forum' (http://www.httppoint.com) | 'Free Blogs'
(http://www.journalhome.com/) | 'webmaster Directory'
(http://www.webhostshunter.com/)
'Recreation Vehicle insurance'
(http://www.insurance-owl.com/other/car_rec.php) | 'Free URL
redirection service' (http://urlkick.com/)
------------------------------------------------------------ ------------
FFMG's Profile: http://www.httppoint.com/member.php?userid=580
View this thread: http://www.httppoint.com/showthread.php?t=22375

Message Posted via the webmaster forum http://www.httppoint.com, (Ad revenue sharing).

Re: unexpected }

am 20.11.2007 10:39:44 von luiheidsgoeroe

On Tue, 20 Nov 2007 06:26:15 +0100, Jim Michaels
wrote:

> Rik Wasmus wrote:
> If you'd have posted you code leading up
>> to the offending brace at line 594 maybe we could spot it...

> I need a 2nd pair of eyes on this problem.

Guess what? We do need the lines to see...

(And thanks for the correct sig seperator BTW :) )
--
Rik Wasmus

Re: unexpected }

am 21.11.2007 20:13:45 von oliver.graetz

Jim Michaels schrieb:
>>> I have a 638 line glob of PHP code & HTML that won't run.
>>> I get "PHP Parse error: syntax error, unexpected '}' in
>>> quiz\\quiz.php on line 594".

Your attachment won't help, the error is not in quiztaker.php but in
quiz.php,

OLLi


--
Cordy: "I think it - I say it. It's my way."
[Angel 107]

Re: unexpected }

am 21.11.2007 21:45:29 von luiheidsgoeroe

On Wed, 21 Nov 2007 20:13:45 +0100, Oliver Grätz
wrote:

> Jim Michaels schrieb:
>>>> I have a 638 line glob of PHP code & HTML that won't run.
>>>> I get "PHP Parse error: syntax error, unexpected '}' in
>>>> quiz\\quiz.php on line 594".
>
> Your attachment won't help, the error is not in quiztaker.php but in
> quiz.php,

Ah, an attachment, that's why there was no code in the post. As this group
hasn't got 'binary' or 'binaries' in its name it didn't even occur to
check to me to check for that :).

Allthough it's a big nono to post attachments, a quick look learns me I
will unfortunatly not check this code. This is truly a maintenance
nightmare. Templates and/or isolating some deeply nested
if/else/while/switch statements seems to be badly needed.
--
Rik Wasmus

Re: unexpected }

am 22.11.2007 00:15:13 von oliver.graetz

Rik Wasmus schrieb:
> Allthough it's a big nono to post attachments, a quick look learns me I
> will unfortunatly not check this code. This is truly a maintenance
> nightmare. Templates and/or isolating some deeply nested
> if/else/while/switch statements seems to be badly needed.

A "php -l" did not yield a parsing error AND the file is 692 lines long
(not 638) AND it is not matching the filename from the error message, so
I doubt the file in question was attached...

Your remarks about isolating are right. Just take out inner blocks until
the error message fades away. Go back one step and find the error
position...

OLLi

--
"My urination just hasn't been public enough lately."
[Cordelia in Angel 105]

Re: unexpected }

am 22.11.2007 00:47:53 von luiheidsgoeroe

On Thu, 22 Nov 2007 00:15:13 +0100, Oliver Grätz
wrote:

> Rik Wasmus schrieb:
>> Allthough it's a big nono to post attachments, a quick look learns me I
>> will unfortunatly not check this code. This is truly a maintenance
>> nightmare. Templates and/or isolating some deeply nested
>> if/else/while/switch statements seems to be badly needed.
>
> A "php -l" did not yield a parsing error AND the file is 692 lines long
> (not 638) AND it is not matching the filename from the error message, so
> I doubt the file in question was attached...

Hmmm, don't know where something went different, a php -l here gave me a:
Parse error: syntax error, unexpected '}' in G:\Personal\quiztaker.php on
line 648
--
Rik Wasmus

Re: unexpected }

am 22.11.2007 02:09:23 von oliver.graetz

Rik Wasmus schrieb:
>> A "php -l" did not yield a parsing error AND the file is 692 lines long
>> (not 638) AND it is not matching the filename from the error message, so
>> I doubt the file in question was attached...
>
> Hmmm, don't know where something went different, a php -l here gave me a:
> Parse error: syntax error, unexpected '}' in G:\Personal\quiztaker.php on
> line 648

# php4 -v
PHP 4.4.7-0.dotdeb.0 with Suhosin-Patch 0.9.6 (cli) (built: May 9 2007
16:38:02)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies

# php4 -l quiztaker.php
No syntax errors detected in quiztaker.php

# php -v
PHP 5.2.5-0.dotdeb.0 with Suhosin-Patch 0.9.6.2 (cli) (built: Nov 12
2007 19:09:20)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies

# php -l quiztaker.php
No syntax errors detected in quiztaker.php

> php -v
PHP 5.2.1 (cli) (built: Feb 7 2007 23:11:26)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with Xdebug v2.0.0, Copyright (c) 2002, 2003, 2004, 2005, 2006,
2007, by Derick Rethans

>php -l quiztaker.php
No syntax errors detected in quiztaker.php


No problems here, not with PHP4 nor PHP5, and not on win32.
I even changed the file from CR+LF to just LF, no change.
Have to mark this as WORKSFORME ;-)

OLLi

--
Programming is an art form that fights back.

Re: unexpected }

am 22.11.2007 02:35:29 von luiheidsgoeroe

On Thu, 22 Nov 2007 02:09:23 +0100, Oliver Grätz
wrote:
> Rik Wasmus schrieb:
>>> A "php -l" did not yield a parsing error AND the file is 692 lines long
>>> (not 638) AND it is not matching the filename from the error message,
>>> so
>>> I doubt the file in question was attached...
>>
>> Hmmm, don't know where something went different, a php -l here gave me
>> a:
>> Parse error: syntax error, unexpected '}' in G:\Personal\quiztaker.php
>> on
>> line 648

> PHP 4.4.7-0.dotdeb.0 with Suhosin-Patch 0.9.6 (cli) (built: May 9 2007
> 16:38:02)
> No syntax errors detected in quiztaker.php

> PHP 5.2.5-0.dotdeb.0 with Suhosin-Patch 0.9.6.2 (cli) (built: Nov 12
> 2007 19:09:20)
> No syntax errors detected in quiztaker.php

> PHP 5.2.1 (cli) (built: Feb 7 2007 23:11:26)
> No syntax errors detected in quiztaker.php
>
>
> No problems here, not with PHP4 nor PHP5, and not on win32.
> I even changed the file from CR+LF to just LF, no change.
> Have to mark this as WORKSFORME ;-)

Win64,
PHP 5.2.4 (cli) (built: Aug 30 2007 07:06:31),
Parse error: syntax error, unexpected '}' in quiztaker.php on line 648

Weird....
--
Rik Wasmus

Re: unexpected }

am 22.11.2007 02:52:53 von luiheidsgoeroe

On Thu, 22 Nov 2007 02:35:29 +0100, Rik Wasmus
wrote:
> On Thu, 22 Nov 2007 02:09:23 +0100, Oliver Grätz
> wrote:
>> Rik Wasmus schrieb:
>>>> A "php -l" did not yield a parsing error AND the file is 692 lines
>>>> long
>>>> (not 638) AND it is not matching the filename from the error message,
>>>> so
>>>> I doubt the file in question was attached...
>>>
>>> Hmmm, don't know where something went different, a php -l here gave me
>>> a:
>>> Parse error: syntax error, unexpected '}' in G:\Personal\quiztaker.php
>>> on
>>> line 648
>
>> PHP 4.4.7-0.dotdeb.0 with Suhosin-Patch 0.9.6 (cli) (built: May 9 2007
>> PHP 5.2.5-0.dotdeb.0 with Suhosin-Patch 0.9.6.2 (cli) (built: Nov 12
>> PHP 5.2.1 (cli) (built: Feb 7 2007 23:11:26)
>> No syntax errors detected in quiztaker.php
>>
>> No problems here, not with PHP4 nor PHP5, and not on win32.
>> I even changed the file from CR+LF to just LF, no change.
>> Have to mark this as WORKSFORME ;-)
>
> Win64,
> PHP 5.2.4 (cli) (built: Aug 30 2007 07:06:31),
> Parse error: syntax error, unexpected '}' in quiztaker.php on line 648
>
> Weird....

md5_file() => f0fa03b6e3479c5f45ff6f0174ad378d
Yours?
--
Rik Wasmus

Re: unexpected }

am 22.11.2007 04:16:32 von oliver.graetz

Rik Wasmus schrieb:
>> Win64,
>> PHP 5.2.4 (cli) (built: Aug 30 2007 07:06:31),
>> Parse error: syntax error, unexpected '}' in quiztaker.php on line 648
>>
>> Weird....
>
> md5_file() => f0fa03b6e3479c5f45ff6f0174ad378d
> Yours?

>php -r "echo md5_file('quiztaker.php')";
f0fa03b6e3479c5f45ff6f0174ad378d

Nope, we're shoveling the same coals into the engine...

And I can even get some HTML output from the script after changing the
top of the file to

function getconfigvar() {return '';}
$_SESSION['minutes']=(int)(ini_get("session.gc_maxlifetime") /60);
?> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
// now the rest follows...

so this is no fake OK message. It reallys seems to have something to do
with some very subtle differences in the PHP version or configuration.
Hard to catch, giving up...

OLLi

--
public class ValidationMessage
{
//internal members
string messageId;
string messageText;
string helpLink;
/* ... */
double cheeseburger;
char broiled;
long time;

//helper functions
/* ... */
}

Re: unexpected }

am 22.11.2007 05:15:26 von Jerry Stuckle

Oliver Grätz wrote:
> Rik Wasmus schrieb:
>>> Win64,
>>> PHP 5.2.4 (cli) (built: Aug 30 2007 07:06:31),
>>> Parse error: syntax error, unexpected '}' in quiztaker.php on line 648
>>>
>>> Weird....
>> md5_file() => f0fa03b6e3479c5f45ff6f0174ad378d
>> Yours?
>
>> php -r "echo md5_file('quiztaker.php')";
> f0fa03b6e3479c5f45ff6f0174ad378d
>
> Nope, we're shoveling the same coals into the engine...
>
> And I can even get some HTML output from the script after changing the
> top of the file to
>
> > function getconfigvar() {return '';}
> $_SESSION['minutes']=(int)(ini_get("session.gc_maxlifetime") /60);
> ?> > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> // now the rest follows...
>
> so this is no fake OK message. It reallys seems to have something to do
> with some very subtle differences in the PHP version or configuration.
> Hard to catch, giving up...
>
> OLLi
>

Remember, when you include the file, it's effectively the same as
copying/pasting the source into the file. IOW, a syntax error (i.e. an
unmatched '"'( can be carried over into the included file.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: unexpected }

am 23.11.2007 23:58:51 von Jim Michaels

Oliver Grätz wrote:
> Jim Michaels schrieb:
>>>> I have a 638 line glob of PHP code & HTML that won't run.
>>>> I get "PHP Parse error: syntax error, unexpected '}' in
>>>> quiz\\quiz.php on line 594".
>
> Your attachment won't help, the error is not in quiztaker.php but in
> quiz.php,
>
> OLLi
>
>



I renamed it. I also added more commented-out code.

--

------------------------------------
Jim Michaels
for email, edit the address

"Because we do not understand the brain very well we are constantly
tempted to use the latest technology as a model for trying to understand
it. In my childhood we were always assured that the brain was a
telephone switchboard. ('What else could it be?') I was amused to see
that Sherrington, the great British neuroscientist, thought that the
brain worked like a telegraph system. Freud often compared the brain to
hydraulic and electro-magnetic systems. Leibniz compared it to a mill,
and I am told some of the ancient Greeks thought the brain functions
like a catapult. At present, obviously, the metaphor is the digital
computer." - John R Searls.

Re: unexpected }

am 24.11.2007 00:21:14 von Jim Michaels

Jerry Stuckle wrote:
> Oliver Grätz wrote:
>> Rik Wasmus schrieb:
>>>> Win64,
>>>> PHP 5.2.4 (cli) (built: Aug 30 2007 07:06:31),
>>>> Parse error: syntax error, unexpected '}' in quiztaker.php on line 648
>>>>
>>>> Weird....
>>> md5_file() => f0fa03b6e3479c5f45ff6f0174ad378d
>>> Yours?
>>
>>> php -r "echo md5_file('quiztaker.php')";
>> f0fa03b6e3479c5f45ff6f0174ad378d
>>
>> Nope, we're shoveling the same coals into the engine...
>>
>> And I can even get some HTML output from the script after changing the
>> top of the file to
>>
>> >> function getconfigvar() {return '';}
>> $_SESSION['minutes']=(int)(ini_get("session.gc_maxlifetime") /60);
>> ?> >> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>> // now the rest follows...
>>
>> so this is no fake OK message. It reallys seems to have something to do
>> with some very subtle differences in the PHP version or configuration.
>> Hard to catch, giving up...
>>
>> OLLi
>>
>
> Remember, when you include the file, it's effectively the same as
> copying/pasting the source into the file. IOW, a syntax error (i.e. an
> unmatched '"'( can be carried over into the included file.
>

when I edited in dreamweaver 8 I don't think I saw any strings out of place.
I am using 3 different versions of PHP. PHP4 & PHP5 from XAMPP, PHP
5.2.3 CLI win32. ALL fail. all have warnings and errors set to full
blast. with XAMPP, all errors are fed into apache/error.log.

I get some HTML, but it's essentially with nothing in
between. the basic HTML page. I also get an error message about the
curly brace in the error log.
with the win32 version I get the error message straignt out on the
command-line.
I'll try removing sections under a different filename and see what happens.
------------------------------------
Jim Michaels

Re: unexpected }

am 24.11.2007 02:31:06 von Jerry Stuckle

Jim Michaels wrote:
> Jerry Stuckle wrote:
>> Oliver Grätz wrote:
>>> Rik Wasmus schrieb:
>>>>> Win64,
>>>>> PHP 5.2.4 (cli) (built: Aug 30 2007 07:06:31),
>>>>> Parse error: syntax error, unexpected '}' in quiztaker.php on line 648
>>>>>
>>>>> Weird....
>>>> md5_file() => f0fa03b6e3479c5f45ff6f0174ad378d
>>>> Yours?
>>>
>>>> php -r "echo md5_file('quiztaker.php')";
>>> f0fa03b6e3479c5f45ff6f0174ad378d
>>>
>>> Nope, we're shoveling the same coals into the engine...
>>>
>>> And I can even get some HTML output from the script after changing the
>>> top of the file to
>>>
>>> >>> function getconfigvar() {return '';}
>>> $_SESSION['minutes']=(int)(ini_get("session.gc_maxlifetime") /60);
>>> ?> >>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>>> // now the rest follows...
>>>
>>> so this is no fake OK message. It reallys seems to have something to do
>>> with some very subtle differences in the PHP version or configuration.
>>> Hard to catch, giving up...
>>>
>>> OLLi
>>>
>>
>> Remember, when you include the file, it's effectively the same as
>> copying/pasting the source into the file. IOW, a syntax error (i.e.
>> an unmatched '"'( can be carried over into the included file.
>>
>
> when I edited in dreamweaver 8 I don't think I saw any strings out of
> place.
> I am using 3 different versions of PHP. PHP4 & PHP5 from XAMPP, PHP
> 5.2.3 CLI win32. ALL fail. all have warnings and errors set to full
> blast. with XAMPP, all errors are fed into apache/error.log.
>
> I get some HTML, but it's essentially with nothing in
> between. the basic HTML page. I also get an error message about the
> curly brace in the error log.
> with the win32 version I get the error message straignt out on the
> command-line.
> I'll try removing sections under a different filename and see what happens.
> ------------------------------------
> Jim Michaels
>

Which says you have a basic syntax error.

Don't trust Dreamweaver (or any other editor) to do your work for you.
They all can make mistakes. And ultimately, YOU are responsible for the
code.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: unexpected }

am 24.11.2007 04:33:25 von Jim Michaels

Jerry Stuckle wrote:
> Oliver Grätz wrote:
>> Rik Wasmus schrieb:
>>>> Win64,
>>>> PHP 5.2.4 (cli) (built: Aug 30 2007 07:06:31),
>>>> Parse error: syntax error, unexpected '}' in quiztaker.php on line 648
>>>>
>>>> Weird....
>>> md5_file() => f0fa03b6e3479c5f45ff6f0174ad378d
>>> Yours?
>>
>>> php -r "echo md5_file('quiztaker.php')";
>> f0fa03b6e3479c5f45ff6f0174ad378d
>>
>> Nope, we're shoveling the same coals into the engine...
>>
>> And I can even get some HTML output from the script after changing the
>> top of the file to
>>
>> >> function getconfigvar() {return '';}
>> $_SESSION['minutes']=(int)(ini_get("session.gc_maxlifetime") /60);
>> ?> >> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>> // now the rest follows...
>>
>> so this is no fake OK message. It reallys seems to have something to do
>> with some very subtle differences in the PHP version or configuration.
>> Hard to catch, giving up...
>>
>> OLLi
>>
>
> Remember, when you include the file, it's effectively the same as
> copying/pasting the source into the file. IOW, a syntax error (i.e. an
> unmatched '"'( can be carried over into the included file.
>

it is possible it is choking on line 661.
$q2=mysql_query("SELECT quiz_id,title,released FROM quiz_quizzes
WHERE
battery_id=".$_SESSION['battery_id'][$_SESSION['test_admin_i d']][$i],
$link) or die(mysql_error());

specifically, on $_SESSION['battery_id'][$_SESSION['test_admin_id']][$i]

I was trying to access a multidimensional array.

when I remove this section of code I get a different error.

you can essentially boil this down to 2 if statements:

include 'header.php';
$_SESSION['minutes']=(int)(ini_get("session.gc_maxlifetime") /60);
?> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">



....blah...


Quiz

//must have just typed in the URL.
if (!isset($_SESSION['uid']) && !isset($_SESSION['battery_id'])) {
?>


You need to register before you can take a
test.








//test admin provided the test taker with a URL that had quiz id and
battery id. specific test.
} elseif (isset($_SESSION['quiz_id'])) {
//battery title
$qb=mysql_query("SELECT title FROM quiz_batteries WHERE
battery_id=".$_SESSION['battery_id'], $link) or die(mysql_error());
$rowb=mysql_fetch_assoc($qb);//to be used later
mysql_free_result($qb);

//quiz title
$qq=mysql_query("SELECT * FROM quiz_quizzes WHERE
quiz_id=".$_SESSION['quiz_id'], $link) or die(mysql_error());
$rowq=mysql_fetch_assoc($qq);
mysql_free_result($qq);
//battery_id provided only by test admin to test taker. let them see the
list of tests they can take.
} else { //elseif (isset($_SESSION['quiz_id']))
//battery title
$q=mysql_query("SELECT battery_id,title FROM quiz_batteries WHERE
battery_id=".$_SESSION['battery_id'][$_SESSION['test_admin_i d']][$i],
$link) or die(mysql_error());
if ($row=mysql_fetch_assoc($q)) {
?>

List of Tests you can take

mysql_free_result($q);
mysql_free_result($q1);
mysql_free_result($q2);
?>
userreports.php">Look at
your reports


} //if ($row=mysql_fetch_assoc($q))
} //elseif (isset($_SESSION['quiz_id']))
?>






--

------------------------------------
Jim Michaels
for email, edit the address

"Because we do not understand the brain very well we are constantly
tempted to use the latest technology as a model for trying to understand
it. In my childhood we were always assured that the brain was a
telephone switchboard. ('What else could it be?') I was amused to see
that Sherrington, the great British neuroscientist, thought that the
brain worked like a telegraph system. Freud often compared the brain to
hydraulic and electro-magnetic systems. Leibniz compared it to a mill,
and I am told some of the ancient Greeks thought the brain functions
like a catapult. At present, obviously, the metaphor is the digital
computer." - John R Searls.

Re: unexpected }

am 24.11.2007 05:30:23 von Jim Michaels

Jim Michaels wrote:
> > include 'header.php';
> $_SESSION['minutes']=(int)(ini_get("session.gc_maxlifetime") /60);
> ?> > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>
>
>
> ...blah...
>
>
>

Quiz

> > //must have just typed in the URL.
> if (!isset($_SESSION['uid']) && !isset($_SESSION['battery_id'])) {
> ?>
>

> You need to register before you can take a
> test.


>

>

>

>
and there's the culprit. I knew it was not a bracket or quote problem. dreamweaver covers quotes
by making mistakes very visible. the tool I wrote covers brackets. but
dw is supposed to handle generic PHP code, therefore it displays same as the difference between your code running or not running - not every
server has short_tags enabled.

and after running the code with the session variables in place, I find
it is still quite buggy due to discovering something very important
missing... time for a rewrite/rethink. ugh. what was I thinking?

anyway, thanks for the help. I wouldn't have gotten this far without a
2nd pair of eyes. thanks again.
------------------------------------
Jim Michaels
for email, edit the address

Re: unexpected }

am 24.11.2007 05:39:11 von Jerry Stuckle

Jim Michaels wrote:
> Jerry Stuckle wrote:
>> Oliver Grätz wrote:
>>> Rik Wasmus schrieb:
>>>>> Win64,
>>>>> PHP 5.2.4 (cli) (built: Aug 30 2007 07:06:31),
>>>>> Parse error: syntax error, unexpected '}' in quiztaker.php on line 648
>>>>>
>>>>> Weird....
>>>> md5_file() => f0fa03b6e3479c5f45ff6f0174ad378d
>>>> Yours?
>>>
>>>> php -r "echo md5_file('quiztaker.php')";
>>> f0fa03b6e3479c5f45ff6f0174ad378d
>>>
>>> Nope, we're shoveling the same coals into the engine...
>>>
>>> And I can even get some HTML output from the script after changing the
>>> top of the file to
>>>
>>> >>> function getconfigvar() {return '';}
>>> $_SESSION['minutes']=(int)(ini_get("session.gc_maxlifetime") /60);
>>> ?> >>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>>> // now the rest follows...
>>>
>>> so this is no fake OK message. It reallys seems to have something to do
>>> with some very subtle differences in the PHP version or configuration.
>>> Hard to catch, giving up...
>>>
>>> OLLi
>>>
>>
>> Remember, when you include the file, it's effectively the same as
>> copying/pasting the source into the file. IOW, a syntax error (i.e.
>> an unmatched '"'( can be carried over into the included file.
>>
>
> it is possible it is choking on line 661.
> $q2=mysql_query("SELECT quiz_id,title,released FROM
> quiz_quizzes WHERE
> battery_id=".$_SESSION['battery_id'][$_SESSION['test_admin_i d']][$i],
> $link) or die(mysql_error());
>
> specifically, on $_SESSION['battery_id'][$_SESSION['test_admin_id']][$i]
>
> I was trying to access a multidimensional array.
>
> when I remove this section of code I get a different error.
>

Should be OK, as long as your $_SESSION elements are OK. I suspect
something else is wrong and this is just leading you astray. Look at the
code preceding this statement.

> you can essentially boil this down to 2 if statements:
>
> > include 'header.php';
> $_SESSION['minutes']=(int)(ini_get("session.gc_maxlifetime") /60);
> ?> > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>
>
>
> ...blah...
>
>
>

Quiz

> > //must have just typed in the URL.
> if (!isset($_SESSION['uid']) && !isset($_SESSION['battery_id'])) {
> ?>
>

> You need to register before you can take a
> test.


>

>

>

> > //test admin provided the test taker with a URL that had quiz id and
> battery id. specific test.
> } elseif (isset($_SESSION['quiz_id'])) {
> //battery title
> $qb=mysql_query("SELECT title FROM quiz_batteries WHERE
> battery_id=".$_SESSION['battery_id'], $link) or die(mysql_error());
> $rowb=mysql_fetch_assoc($qb);//to be used later
> mysql_free_result($qb);
>
> //quiz title
> $qq=mysql_query("SELECT * FROM quiz_quizzes WHERE
> quiz_id=".$_SESSION['quiz_id'], $link) or die(mysql_error());
> $rowq=mysql_fetch_assoc($qq);
> mysql_free_result($qq);
> //battery_id provided only by test admin to test taker. let them see the
> list of tests they can take.
> } else { //elseif (isset($_SESSION['quiz_id']))
> //battery title
> $q=mysql_query("SELECT battery_id,title FROM quiz_batteries WHERE
> battery_id=".$_SESSION['battery_id'][$_SESSION['test_admin_i d']][$i],
> $link) or die(mysql_error());
> if ($row=mysql_fetch_assoc($q)) {
> ?>
>

>
List of Tests you can take

> > mysql_free_result($q);
> mysql_free_result($q1);
> mysql_free_result($q2);
> ?>
> userreports.php">Look at
> your reports


> > } //if ($row=mysql_fetch_assoc($q))
> } //elseif (isset($_SESSION['quiz_id']))
> ?>
>

>
>
>
>


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: unexpected }

am 24.11.2007 13:50:58 von oliver.graetz

Jim Michaels schrieb:
>
> anyway, thanks for the help. I wouldn't have gotten this far without a
> 2nd pair of eyes. thanks again.

I tried a lot but in the end you had to find it yourself. Sorry, but I
couldn't make the database calls for you without a copy of the database.

OLLi

--
guy pouring the alcohol away...
"That is a single malt. What kind of a monster are ya?"
[Life on Mars 106]